package com.winit.template.service;

import com.winit.common.base.BaseController;
import com.winit.common.util.JSONFileUtil;
import com.winit.template.factory.TemplateFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * Created by wangjian on 2017/9/28.
 */
@Service
public class TemplateService {

    private static Logger logger = LoggerFactory.getLogger(TemplateService.class);

    @Autowired
    TemplateFactory factory;

    public String render(String templateContent, Map dataModel) throws IOException {
        logger.info("com.winit.template.service.TemplateService.render templateContent:" + templateContent + ";dataModel=" + dataModel);
        return factory.render(templateContent, dataModel);
    }

}
